package cn.gogpay.dcb.api.dao;

import cn.gogpay.dcb.api.entity.UserBusCard;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import java.util.Optional;

/**
 * Template实体对应的Repository类
 *
 * @author xxx@gogpay.cn
 * @date 2018/4/2 19:37
 */
public interface UserBusCardRepository extends JpaRepository<UserBusCard, String> {
    /**
     * by userId
     *
     * @param id
     * @return
     */
    Optional<List<UserBusCard>> findAllByUseIdOrderByCreatedDateDesc(String id);

    /**
     * by cardNo
     *
     * @param cardNo
     * @return
     */
    Optional<List<UserBusCard>> findAllByCardNoOrderByCreatedDateDesc(String cardNo);
}
